import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	private static ArrayList<Student> studentList = new ArrayList<>();
	private static ArrayList<Course> courseList = new ArrayList<>();
	static boolean isMenuShow=false;
	public static void main(String[] args){
		showMenu();
	}

	private static void showMenu() {
		while(true){
			try{
				Thread.sleep(1000);
			}catch(InterruptedException e){
				e.printStackTrace();
			}
			if(!isMenuShow){
				PrintUtil.printMenu(null);
				isMenuShow=true;
				
				Scanner sc=new Scanner(System.in);
				int i;
				try{
					i=sc.nextInt();
					switch(i){
					case 1:
					   studentList = StudentDao.queryStudentList();
					  PrintUtil.print(studentList);
					   break;
					case 2:
						courseList = CourseDao.queryCourseList();
						PrintUtil.print1(courseList);
						break;
					case 3:
						break;
					case 4:
						break;
					case 5:
						System.exit(0);
						break;
						default:
					System.out.println("你的输入有误，请重新输入");
					break;
					}
					
				}catch(Exception e){
					System.out.println("你的输入有误，请重新输入");
				}
				isMenuShow=false;
			}
		}
		
	}
	
}